package com.zyj.guava.partition;

import java.util.ArrayList;
import java.util.List;

/**
 * 假设现在你的任务是给100w个用户发送消息
 */
public class Sample1 {
    public static void main(String[] args) {
        //1. 获取所有需要接收消息的用户
        List<Long> userIds = Ids.getUserIds();
        //2. 根据用户id, 构造消息体
        List<Operation.Msg> msgList = new ArrayList<>();
        for (Long userId : userIds) {
            msgList.add(Operation.buildMsg(userId));
        }
        //3. 发送消息
        Operation.sendMsg(msgList);
    }
}
